package cn.com.ethos.search.query;

public class Config {
	private String path;
	private int port = 27888;
	private int minThreadsNum = 10;
	private int maxThreadsNum = 100;
	private boolean isContinueOnError = false;

	private int timeout = 30*1000;
	
	public Config(String path, int port, int minThreadsNum, int maxThreadsNum,
			boolean isContinueOnError) {
		super();
		this.path = path;
		this.port = port;
		this.minThreadsNum = minThreadsNum;
		this.maxThreadsNum = maxThreadsNum;
		this.isContinueOnError = isContinueOnError;
	}
	public Config() {
		super();
	}

	public String getPath() {
		return this.path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public int getPort() {
		return this.port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public int getMinThreadsNum() {
		return this.minThreadsNum;
	}

	public void setMinThreadsNum(int minThreadsNum) {
		this.minThreadsNum = minThreadsNum;
	}

	public int getMaxThreadsNum() {
		return this.maxThreadsNum;
	}

	public void setMaxThreadsNum(int maxThreadsNum) {
		this.maxThreadsNum = maxThreadsNum;
	}

	public boolean isContinueOnError() {
		return this.isContinueOnError;
	}

	
	public int getTimeout() {
		return this.timeout;
	}
	public void setTimeout(int timeout) {
		this.timeout = timeout;
	}
	
	public void setContinueOnError(boolean isContinueOnError) {
		this.isContinueOnError = isContinueOnError;
	}
	
	public String toString() {
		return 	"\r\n" +
				"\tPort: " + this.port + "\r\n" +
				"\tPath: " + this.path + "\r\n" +
				"\tTime out: " + this.timeout + "\r\n" +
				"\tMin threads: " + this.minThreadsNum + "\r\n" + 
				"\tMax threads: " + this.maxThreadsNum + "\r\n" +
				"\tContinue when error: " +this.isContinueOnError;
	}	
}
